package Expe10;

/**
 * @Author 28021
 * @Date 2022/11/15
 */
public class Test4 {
    public static void main(String[] args) {

        Simulator simulator = new Simulator();
        simulator.playSound(new Dog());           //创建子类对象并传递
        simulator.playSound(new Cat());

    }
}